<?php

/**
 * Description of callStack
 *
 * @author Christoph Vieth <mail@christoph-vieth.de>
 */
class callStack {

    public function __construct() {
        if (!is_array($GLOBALS['callStack'])) {
            $GLOBALS['callStack'] = array();
            return true;
        } else {
            return false;
        }
    }

    public function __destruct() {
        unset($GLOBALS['callStack']);
    }

    public function push($callName) {
        array_push($GLOBALS['callStack'], $callName);
    }

    public function pop() {
        return array_pop($GLOBALS['callStack']);
    }

}

?>
